﻿#ifndef _FD_MODELTREE_H_
#define _FD_MODELTREE_H_ 

#include "../dll_cfg.h"
#include "kernel/OgreDataStream.h"
#include "udataset/mdb/ModelMetaInfo.h"
#include "udataset/CommonDef.h"

namespace FD
{
	namespace Utility
	{
		namespace Dataset
		{
			struct FD_XDataset_Export ModelTree
			{
			public:
				std::set<ModelTree*> mChildren;
				ModelTree* mpParent;

				String nodeName;
				String nodeGuid;
				String nodeGuid2;
				String parentNodeGuid;

				uint32 treeFDID;
				uint32 treePID;

#ifndef FDB_LINUX
				uint32 id;
				uint32 parentID;
#endif

				SimpleBound nodeBound;
				FD::Kernel::MemoryDataStreamPtr boundStream;

#ifndef FDB_LINUX
				std::map<String, String> attrs;
				FD::Kernel::MemoryDataStreamPtr attrsStream;
				ModelMetaInfo metaInfo;
#endif
				
			public:
				ModelTree();
				~ModelTree();

				void boundToStream();
				void boundFromStream();
#ifndef FDB_LINUX
				void attrsToStream();
				void attrsFromStream();
#endif
			};

			typedef std::vector<ModelTree*> ModelTreeVec;
		}
	}
}


#endif
